using System;
using System.Collections.Generic;
using M1;
using UnityEngine;

[CreateAssetMenu(fileName = "皮肤数据配置",menuName = "创建数据/皮肤数据配置")]
public class 皮肤数据 : BaseModel<皮肤数据,皮肤Data>
{
    // public List<皮肤dat>

#if UNITY_EDITOR
    public override void editor检查数据()
    {
        base.editor检查数据();
        foreach (var VARIABLE in Datas)
        {
            if (!string.IsNullOrEmpty(VARIABLE.path))
            {
                var m = UnityEditor.AssetDatabase.LoadAssetAtPath<Material>(VARIABLE.path);
                VARIABLE.Mat = m;
            }
            if (!string.IsNullOrEmpty(VARIABLE.Iconpath))
            {
                var m = UnityEditor.AssetDatabase.LoadAssetAtPath<Sprite>(VARIABLE.Iconpath);
                VARIABLE.Icon = m;
            }
        }
    }
#endif
    
}

[Serializable]
public class 皮肤Data
{
    public int Id;
    public int Index;
    public int Sex;
    public 皮肤部位 Type;
    public string Name;
    public string path;
    public string Iconpath;
    public Material Mat;
    public Sprite Icon;
}

public enum 皮肤部位
{
    装饰,
    头发,
    上衣,
    裤子,
}
public enum 皮肤装饰
{
    背包,
    帽子,
}